#include <cstdint>

// 定义 PI_PAR1 和 PI_PAR2
const int32_t PI_PAR1 = 1686629713; // m3p29 pi*2^29
const int32_t PI_PAR2 = 1686629713; // p36 (2*pi/256)*2^36

// m2p30
const int32_t sin_par[] = {
    0, 26350943, 52686014, 78989349,
    105245103, 131437462, 157550647, 183568930,
    209476638, 235258165, 260897982, 286380643,
    311690799, 336813204, 361732726, 386434353,
    410903207, 435124548, 459083786, 482766489,
    506158392, 529245404, 552013618, 574449320,
    596538995, 618269338, 639627258, 660599890,
    681174602, 701339000, 721080937, 740388522,
    759250125, 777654384, 795590213, 813046808,
    830013654, 846480531, 862437520, 877875009,
    892783698, 907154608, 920979082, 934248793,
    946955747, 959092290, 970651112, 981625251,
    992008094, 1001793390, 1010975242, 1019548121,
    1027506862, 1034846671, 1041563127, 1047652185,
    1053110176, 1057933813, 1062120190, 1065666786,
    1068571464, 1070832474, 1072448455, 1073418433,
    1073741824, 1073418433, 1072448455, 1070832474,
    1068571464, 1065666786, 1062120190, 1057933813,
    1053110176, 1047652185, 1041563127, 1034846671,
    1027506862, 1019548121, 1010975242, 1001793390,
    992008094, 981625251, 970651112, 959092290,
    946955747, 934248793, 920979082, 907154608,
    892783698, 877875009, 862437520, 846480531,
    830013654, 813046808, 795590213, 777654384,
    759250125, 740388522, 721080937, 701339000,
    681174602, 660599890, 639627258, 618269338,
    596538995, 574449320, 552013618, 529245404,
    506158392, 482766489, 459083786, 435124548,
    410903207, 386434353, 361732726, 336813204,
    311690799, 286380643, 260897982, 235258165,
    209476638, 183568930, 157550647, 131437462,
    105245103, 78989349, 52686014, 26350943,
    0, -26350943, -52686014, -78989349,
    -105245103, -131437462, -157550647, -183568930,
    -209476638, -235258165, -260897982, -286380643,
    -311690799, -336813204, -361732726, -386434353,
    -410903207, -435124548, -459083786, -482766489,
    -506158392, -529245404, -552013618, -574449320,
    -596538995, -618269338, -639627258, -660599890,
    -681174602, -701339000, -721080937, -740388522,
    -759250125, -777654384, -795590213, -813046808,
    -830013654, -846480531, -862437520, -877875009,
    -892783698, -907154608, -920979082, -934248793,
    -946955747, -959092290, -970651112, -981625251,
    -992008094, -1001793390, -1010975242, -1019548121,
    -1027506862, -1034846671, -1041563127, -1047652185,
    -1053110176, -1057933813, -1062120190, -1065666786,
    -1068571464, -1070832474, -1072448455, -1073418433,
    -1073741824, -1073418433, -1072448455, -1070832474,
    -1068571464, -1065666786, -1062120190, -1057933813,
    -1053110176, -1047652185, -1041563127, -1034846671,
    -1027506862, -1019548121, -1010975242, -1001793390,
    -992008094, -981625251, -970651112, -959092290,
    -946955747, -934248793, -920979082, -907154608,
    -892783698, -877875009, -862437520, -846480531,
    -830013654, -813046808, -795590213, -777654384,
    -759250125, -740388522, -721080937, -701339000,
    -681174602, -660599890, -639627258, -618269338,
    -596538995, -574449320, -552013618, -529245404,
    -506158392, -482766489, -459083786, -435124548,
    -410903207, -386434353, -361732726, -336813204,
    -311690799, -286380643, -260897982, -235258165,
    -209476638, -183568930, -157550647, -131437462,
    -105245103, -78989349, -52686014, -26350943};

// p14
const int exp_lut[32] = {
    16562,
    16925,
    17295,
    17674,
    18061,
    18456,
    18861,
    19274,
    19696,
    20127,
    20568,
    21018,
    21478,
    21949,
    22429,
    22920,
    23422,
    23935,
    24459,
    24995,
    25542,
    26102,
    26673,
    27257,
    27854,
    28464,
    29087,
    29724,
    30375,
    31040,
    31720,
    32415,
};